
--[[
	**********************
	* SvFrame - thomasfn *
	**********************
	ignite.lua - Loads basic fire functionality
]]

function PLUGIN:InitIgnite()
	svr.AddFlag( "ignite" )
	
	self:Command( "ignite", self.Ignite, { FLAG_IGNITE }  )
	self:Command( "extinguish", self.Extinguish, { FLAG_IGNITE }  )
end

table.insert( PLUGIN.Inits, PLUGIN.InitIgnite )

function PLUGIN:Ignite( ply, args )
	if (not svr.CheckArg( args, 1, "string" )) then return ply:ChatPrint( colour.White, "Syntax: /ignite <name>" ) end
	local target = svr.PlayerByName(args[1])
	svr.ChatPrint( nil, ply:Name(), " ignited ", target:Name(), "." )
	target.Fire( true )
end

function PLUGIN:Extinguish( ply, args )
	if (not svr.CheckArg( args, 1, "string" )) then return ply:ChatPrint( colour.White, "Syntax: /extinguish <name>" ) end
	local target = svr.PlayerByName(args[1])
	svr.ChatPrint( nil, ply:Name(), " extinguished ", target:Name(), "." )
	target.Fire( false )
end
